﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TrainingCenterSystem.UserManagement
{
    public class UserHandler
    {
        #region methods
        public static bool UserExists(ArrayList users, User aUser)
        {
            for (int i = 0; i < users.Count; i++)
            {
                if (((User)users[i]).Username == aUser.Username)
                    return true;
            }
                return false;
        }

        public static User GetUser(ArrayList users, User aUser)
        {
            for (int i = 0; i < users.Count; i++)
            {
                if (((User)users[i]).Username == aUser.Username)
                    return (User)users[i];
            }
            return null;
        }
        #endregion
    }
}
